{% extends 'base.html' %}
{% from 'macros.html' import form_field %}
{% block body %}
    <form method="post" action="{{ url_for('admin.update',post_id=post.id) }}">
        {{ form.csrf_token }}
        {{ form_field(form.title) }}
        {{ form_field(form.body) }}
        {{ form.submit }}
    </form>
    {% for msg in get_flashed_messages() %}
        <p class="err">{{ msg }}</p>
    {% endfor %}
    <h2>Comments</h2>
    {% for comment,username in data %}
        <div class="container-fluid">
        <h4>{{ comment.body }}</h4>
        <p>{{ username }}</p><small>{{ moment(post.timestamp).fromNow(refresh=True) }}</small>
            <small><a class="btn" type="button" href="{{ url_for('admin.delete',comment_id=comment.id,post_id=post.id) }}">删除</a></small>
        </div>
    {% endfor %}
{% endblock %}
{% block script %}
{{ super() }}
{{ ckeditor.load() }}
{% endblock %}